#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
NameVirtualHost *:443


##
# domain_abbreviation
##

<VirtualHost *:80>
    ServerAdmin server_email@domain.com
    DocumentRoot "C:/Program Files (x86)/Apache_2.2/htdocs"
    <Directory "C:/Program Files (x86)/Apache_2.2/htdocs">
        Options Indexes FollowSymLinks MultiViews Includes
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    ServerName www.domain.com
    ServerAlias www.domain.com
    ErrorLog "logs/www.domain.com-error.log"
    CustomLog "logs/www.domain.com.log" common

    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/images/.*$
    RewriteCond %{REQUEST_URI} !^/osafe_theme/.*$
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteCond %{DOCUMENT_ROOT}}%{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/online/.*$
    RewriteRule ^(.*)$ http://www.domain.com/online$1 [R=301,L]


    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass /images ajp://localhost:8007/images
    ProxyPassReverse /images ajp://localhost:8007/images
    ProxyPass /online ajp://localhost:8007/online
    ProxyPassReverse /online ajp://localhost:8007/online
    ProxyPass /osafe_theme ajp://localhost:8007/osafe_theme
    ProxyPassReverse /osafe_theme ajp://localhost:8007/osafe_theme
	ProxyPass /osafe ajp://localhost:8007/osafe
	ProxyPassReverse /osafe ajp://localhost:8007/osafe

</VirtualHost>

<VirtualHost *:443>
    ServerAdmin server_email@domain.com
    DocumentRoot "C:/Program Files (x86)/Apache_2.2/htdocs"
    <Directory "C:/Program Files (x86)/Apache_2.2/htdocs">
        Options Indexes FollowSymLinks MultiViews Includes
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    ServerName www.domain.com
    ServerAlias www.domain.com
    ErrorLog "logs/https.www.domain.com-error.log"
    CustomLog "logs/https.www.domain.com-access.log" common

    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/images/.*$
    RewriteCond %{REQUEST_URI} !^/osafe_theme/.*$
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteCond %{DOCUMENT_ROOT}}%{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/online/.*$
	RewriteCond %{REQUEST_URI} !^/osafe-admin/.*$	
	RewriteCond %{REQUEST_URI} !^/osafe_admin_theme/.*$
	RewriteCond %{REQUEST_URI} !^&#47;osafe_admin_theme&#47;.*$
    RewriteRule ^(.*)$ http://www.domain.com/online$1 [R=301,L]

    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass /images ajp://localhost:8007/images
    ProxyPassReverse /images ajp://localhost:8007/images
    ProxyPass /online ajp://localhost:8007/online
    ProxyPassReverse /online ajp://localhost:8007/online
    ProxyPass /osafe_theme ajp://localhost:8007/osafe_theme
    ProxyPassReverse /osafe_theme ajp://localhost:8007/osafe_theme    
	
	ProxyPass /admin ajp://localhost:8007/osafe-admin/control/main
    ProxyPassReverse /admin ajp://localhost:8007/osafe-admin/control/main
	ProxyPass /osafe-admin ajp://localhost:8007/osafe-admin
    ProxyPassReverse /osafe-admin ajp://localhost:8007/osafe-admin
    ProxyPass /osafe_admin_theme ajp://localhost:8007/osafe_admin_theme
    ProxyPassReverse /osafe_admin_theme ajp://localhost:8007/osafe_admin_theme   
    
	
    SSLEngine On
    SSLCertificateFile "C:/Program Files (x86)/Apache_2.2/conf/domain_abbreviation/domain.com.crt"
		SSLCertificateChainFile "C:/Program Files (x86)/Apache_2.2/conf/domain_abbreviation/fd_bundle.crt"
    SSLCertificateKeyFile "C:/Program Files (x86)/Apache_2.2/conf/domain_abbreviation/www_domain_com.key"


</VirtualHost>




